package com.k2data.k2app.domain.po;

import com.k2data.k2app.common.MyConstant;
import com.k2data.k2app.utils.StringUtils;
import lombok.Data;

/**
 * 任务和作业关联表
 */
@Data
public class EarlyWaringDTO extends EarlyWaringDO{

	/**
	 * 根据状态名称设置对象的状态属性
	 *
	 * @param earlyWaringDO
	 * @param status
	 */
	public static void setWarningType(EarlyWaringDO earlyWaringDO,String status){
		if(!StringUtils.isEmpty(status)){
			if(MyConstant.WARING_TYPE_MQ.equals(status)){
				earlyWaringDO.setIsMq(MyConstant.YES_INTEGER);
			}else if(MyConstant.WARING_TYPE_SMS.equals(status)){
				earlyWaringDO.setIsSms(MyConstant.YES_INTEGER);
			}else if(MyConstant.WARING_TYPE_MAIL.equals(status)){
				earlyWaringDO.setIsMail(MyConstant.YES_INTEGER);
			}
		}
	}
}